import 'dart:convert';

class FamilyAddModel {
  String msgType;
  String msgId;
  String title;
  MemberInfo content;

  FamilyAddModel(
      {String msgType, String msgId, String title, MemberInfo content}) {
    this.msgType = msgType;
    this.msgId = msgId;
    this.title = title;
    this.content = content;
  }

  factory FamilyAddModel.fromJson(Map<String, dynamic> json) {
    print(json["content"]);
    return FamilyAddModel(
        msgType: json["msgType"],
        msgId: json["msgId"],
        title: json["title"],
        content: MemberInfo.fromJson(JsonCodec().decode(json["content"])));
  }
}

//{"msgType":"memberAdd","msgId":"94dad826ef974cae8b93960982c484a2",
// "title":"添加家庭成员","content":"{\"memberName\":\"纪\",\"memberId\":\"b64e00df14e84fd28075d7f86b0c067e\"}"}
class MemberInfo {
  String memberName;
  String memberId;

  MemberInfo({String memberName, String memberId}) {
    this.memberName = memberName;
    this.memberId = memberId;
  }

  factory MemberInfo.fromJson(Map<String, dynamic> json) {
    return MemberInfo(
        memberName: json["memberName"], memberId: json["memberId"]);
  }
}
